const homeData = require('./public/mock/index.json')
const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  lintOnSave: false,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('styles', resolve('src/assets/styles'))
      .set('imgs', resolve('src/assets/imgs'))
  },
  devServer: {
    before(app) {
      app.get('/api/home', (req, resp, next) => {
        resp.json({
          homeData
        })
      })
    }
  }
}
